#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    vector<int> twoSum(vector<int>& price, int target) {
        int left = 0, right = price.size() - 1;
        vector<int> arr;
        while (left != right)
        {
            if (price[left] + price[right] == target)
            {
                arr.push_back(price[left]);
                arr.push_back(price[right]);
                return arr;
            }
            if (price[left] + price[right] < target)
                left++;
            else
                right--;
        }
        return arr;
    }
};